package Tree;

public class Test {
    public static void main(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.BTNode root = binaryTree.createBinaryTree();
//        binaryTree.preOrder(root);
////        System.out.println();
////        binaryTree.inOrder(root);
////        System.out.println();
////        binaryTree.postOrder(root);
//        System.out.println(binaryTree.size(root));
//        System.out.println(binaryTree.getLeafNodeCount(root));
        binaryTree.getLeafNodeCount1(root);
        System.out.println(binaryTree.leafCount);
        System.out.println(binaryTree.getLeafNodeCount2(root));
        System.out.println("========");
        System.out.println("第K层节点个数：");
        System.out.println(binaryTree.getKLevelNodeCount(root, 2));
        System.out.println("二叉树高度：");
        System.out.println(binaryTree.getHeight(root));
        System.out.println("value是否存在");
        System.out.println(binaryTree.find(root, 6));
        System.out.println("层序遍历");
        binaryTree.levelOrder(root);
    }
}
